# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=podofo
pkgver=0.9.6
pkgrel=2
pkgdesc="A C++ library to work with the PDF file format"
url="http://podofo.sourceforge.net"
arch="all"
license="GPL-2.0-only"
makedepends="tiff-dev libpng-dev fontconfig-dev
cmake lua-dev openssl-dev libidn-dev"
subpackages="$pkgname-dev $pkgname-doc"
source="https://downloads.sourceforge.net/podofo/podofo-$pkgver.tar.gz
	podofo-cmake-3.12.patch
	"

# secfixes:
#   0.9.5-r0:
#     - CVE-2017-6843
#     - CVE-2017-6844
#     - CVE-2017-6845
#     - CVE-2017-6846
#     - CVE-2017-6847
#     - CVE-2017-6849

build() {
	cmake -B build . \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DPODOFO_BUILD_SHARED=1 \
		-DPODOFO_HAVE_JPEG_LIB=1 \
		-DPODOFO_HAVE_PNG_LIB=1 \
		-DPODOFO_HAVE_TIFF_LIB=1
	make -C build
}
package() {
	make -C build DESTDIR="$pkgdir" install
}

sha512sums="35c1a457758768bdadc93632385f6b9214824fead279f1b85420443fb2135837cefca9ced476df0d47066f060e9150e12fcd40f60fa1606b177da433feb20130  podofo-0.9.6.tar.gz
6c14a620debeb12a36169f225382c08f5367d8cf93d9d3678bec94ce44dabcf235a7d87c2c29b7c8f5daa8abc9f7415e9e58fa3720388cbbf082b7f63896863f  podofo-cmake-3.12.patch"
